import axios from 'axios'

// create an axios instance
const service = axios.create({
  headers: {'content-type': 'application/json'},
  timeout: 60000 // request timeout
})

// request interceptor
service.interceptors.request.use(config => {

    // config.headers['Authorization'] = "Bearer "+ getToken();

    return config;
  },

  err => {
    return Promise.reject(err);
  }
);

// respone interceptor
service.interceptors.response.use(
  response =>{
    console.info(response)
    return Promise.resolve(response);
  },

  error => {
    console.info(error)

    return Promise.reject(error)
  })

export default service
